home *** CD-ROM | disk | FTP | other *** search
- //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- //─────────────────────────────────────────────────────────────────────────
- #include <dos.h>
- #include <conio.h>
-
- // globals for this library
-
- char origvideomode;
-
- //
- // waitvrt - waits for the video retrace to occur, so the screen is
- // updated during the retrace (eliminates flicker) Retrace occurs at
- // 70Hz.
- //
- void waitvrt(void)
- {
- asm mov dx,03DAh
- ct1: asm in al,dx
- asm test al,08h
- asm je ct1
- ct2: asm in al,dx
- asm test al,08h
- asm jne ct2
- }
- //
- // grmode(): puts the VGA card into 320x200x256 mode. (mode 13h)
- //
- void grmode(void)
- {
- // save original video mode for exit
- asm mov ah,0Fh
- asm int 10h
- origvideomode = _AL;
-
- asm mov ax,0013h ;// int 10h - set gr mode
- asm int 10h ;// mode 13h, 320x200x256
- }
-
- //
- // tmode(): puts the VGA card into 80x25 text mode. (mode 03h)
- //
- void tmode(void)
- {
- asm xor ax,ax ;//int 10h - set gr mode
- _AL = origvideomode;
- asm int 10h ;//original video mode
- }
-
- void plotbmp(int x, int y, int xs, int ys, char *bmp)
- {
- unsigned int p,c,d,e=0;
- p = (y*320)+x;
- for (d=0;d<ys;d++)
- {
- for (c=0;c<xs;c++)
- {
- pokeb(0xA000,p+c,bmp[e]);
- e++;
- }
- p+=320;
- }
- }
-
-